package com.walter.quickstart;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.enterprise.context.ApplicationScoped;

/**
 * 依赖注入
 * 执行对象生命周期事件
 */
@ApplicationScoped
public class GreetingService {

    public String getGreeting(){
        return "Hello";
    }

    @PostConstruct
    public void init(){
        System.out.printf("=============>init");
    }

    @PreDestroy
    public void end(){
        System.out.printf("=============>end");
    }
}
